5-E
Simple site for the info you need...
  • Add Local Admin
  • Backup Dogecoin Wallet
  • Batch Start Powershell
  • Copy A File(s) To All Users On A PC
  • CPU Load Test
  • Disable Users
  • Email Group Members
  • Email With Powershell
  • Exchange Total Size
  • Export to XLSX
  • Export User Cert
  • Get System Info
  • Import Active Directory Module
  • Last Login For All Computer
  • Last Login For All Users
  • Last Login For Select Users
  • List Domain controllers
  • List Groups (With Count) In Active Directory To TXT
  • List Groups (With Count) In Active Directory To XLSX
  • List Groups For A User(s)
  • List Groups In Active Directory to TXT
  • List Home Directory
  • List Members In A Group(s)
  • Password Generator
  • Ping Test
  • Printer Reset
  • Run A Process Every Few Minutes
  • Search For Files On All Local Drives
  • Show iSCSI Device And Disk Number
  • Uninstall Java

Uninstall Java With Powershell

Java, like many 3rd party apps are hard to keep on lock down. Users are prompted to install Java around every bend of the inter webs. This tool will help maintain a level of controll, well at least some control. This powershell script will stop and uninstall any Java client that is not 7.51. You can run this tool locally or push it out through GPO.
CODE:
$programs = Get-WmiObject Win32_Product 
$processes = Get-Process -Name "Java*" 
$keeper = 51 
$userprofile = $env:userprofile 
$log = "$userprofile\AppData\Local\Remove-Java.log" 
$date = Get-Date 
write-output "Started $date" >$log 
if ($processes.Count -gt 0){ 
write-output "--Killing-Process---------" >>$log 
foreach ($myprocess in $processes){ 
$myprocess.kill() 
write-output "Killed $myprocess" >>$log}} 
else{} 
write-output "--UnInstalling------------" >>$log 
foreach ($program in $programs){ 
if (($program.name -like "*java*")-or($program.name -like "*J2SE*")-and($program.name -notlike "*$keeper*")){ 
$program.uninstall() 
write-output Removed $program.name >>$log} 
else{write-output Skipping $program.name >>$log} 
} 
$date = Get-Date 
write-output "Finished $date" >>$log 
Use at your own risk
Download: Uninstall Java.zip

Tag(s): Local PC Powershell Security


Could you spare a few coins?
Dogecoin - D838u1m9YRdzVVu8CZ1JsR78WHgQmUZSr8
Bitcoin - 13iKLoPXcWEYcGtqCi4UcjGQEs7r6M6LFc
Thank you
  • Home

  • Batch
  • Email
  • Exchange
  • How To
  • Local PC
  • Powershell
  • Security